<?php

function form_education_selector($value = '1')
{
	$ci =& get_instance();
	return form_dropdown('education', $ci->config->item('education'), $value, 'id="education"');
}

function category_selector($value = '')
{
	$ci =& get_instance();
	$cat = array('' => "선택하세요");
	$cat += $ci->config->item('category');
	return form_dropdown('category', $cat, $value, 'id="category"');
}

function category_str($id)
{
	$ci =& get_instance();
	$categories = $ci->config->item('category');
	return $categories[$id];
}

function education_str($id)
{
	$ci =& get_instance();
	$edu = $ci->config->item('education');
	return $edu[$id];
}

function poll_create_button()
{
	$ci =& get_instance();
	if($ci->user_lib->is_logged_in())
	{
		return anchor('poll/create', '설문작성', array('data-ajax'=>'false', 'data-role'=>'button', 'data-icon'=>'plus', 'class' => 'ui-btn-right'));
	}
	return '';
}
